package deprecated;
import Month;

import java.util.ArrayList;
    
/** 
 * This class holds the information for a Month and all of the days and their appointments in it.
 *  
 * @author Matthew Edwards 
 * @version 3-5-11
 */
public class AppointmentMonth {
    
    private ArrayList<AppointmentDay> days;
    private Month month;
    private int year;
    
    /**
     * Creates a new month.
     */
    public AppointmentMonth(Month month, int year){
    	this.month = month;
    	this.year = year;
        days = new ArrayList<AppointmentDay>();
        setupDays();
    }
    
    /**
     * This sets up the days in each month so that there are the correct number of days per given month.
     */
    private void setupDays(){
    	String mon = month.toString();
    	if("January".equals(mon)){
    		for(int i = 1; i <= 31; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("February".equals(mon)){
    		for(int i = 1; i <= 28; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("March".equals(mon)){
    		for(int i = 1; i <= 31; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("April".equals(mon)){
    		for(int i = 1; i <= 30; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("May".equals(mon)){
    		for(int i = 1; i <= 31; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("June".equals(mon)){
    		for(int i = 1; i <= 30; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("July".equals(mon)){
    		for(int i = 1; i <= 31; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("August".equals(mon)){
    		for(int i = 1; i <= 31; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("September".equals(mon)){
    		for(int i = 1; i <= 30; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("October".equals(mon)){
    		for(int i = 1; i <= 31; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("November".equals(mon)){
    		for(int i = 1; i <= 30; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}else if("December".equals(mon)){
    		for(int i = 1; i <= 31; i++){
    			days.add(new AppointmentDay(i));
    		}
    	}
    }
    
    /**
     * The name of the month.
     * 
     * @return the name of the month
     */
    public String getMonth(){
    	return month.toString();
    }
    
    /**
     * The year that this month is in.
     * 
     * @return the year.
     */
    public int getYear(){
    	return year;
    }
    
    /**
     * Gets the days inside the calendar
     * 
     * @return the days of the Appointment
     */
    public ArrayList<AppointmentDay> getDays()
    {
        return days;
    }
    
}